function toExcelMain(inDir,outDir)

files=dir(fullfile(inDir,'pliXsubjs_*'));

for i=1:length(files)
    fileName=files(i).name;
    load(fullfile(inDir,fileName));
    
    fileout=strtok(fileName,'.');
    
    toExcel(fullfile(outDir,strcat(fileout,'_cond-one.xls')),cond_one);
    toExcel(fullfile(outDir,strcat(fileout,'_cond-two.xls')),cond_two);
end


function toExcel(fileout,pliXcond)

nSubjs=size(pliXcond,1);

for i=1:nSubjs
    xlswrite(fileout,squeeze(pliXcond(i,:,:)),i)
end